package com.moneylee.xdstudy.controller;

import com.moneylee.xdstudy.domain.Video;
import com.moneylee.xdstudy.service.VideoService;
import com.moneylee.xdstudy.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @className: VideoController
 * @Description: TODO
 * @Author moneylee
 * @Date 2020-06-30 14:26
 * @Version 1.0
 **/

@RestController
@RequestMapping("/api/v1")
public class VideoController {

    @Autowired
    private VideoService videoService;

    @RequestMapping("videos")
    public Object getVideos() {
        List<Video> videos = videoService.listVideo();
        return JsonData.buildSuccess(videos);
    }


}
